package org.orange.feign.simulate.simple.feign.core;

import lombok.Data;
import org.orange.feign.simulate.simple.feign.core.util.SpringContextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.client.RestTemplate;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Map;

/**
 * @author yuhongtai
 */
@Data
public class ReflectiveFeign extends SimpleFeign {

    @Autowired
    private SpringContextUtil contextUtil;

    private String url;

    private Map<Method, InvocationHandlerFactory.MethodHandler> methodToMethodHandler;

    private InvocationHandlerFactory invocationHandlerFactory;


    /**
     * 真正的代理对象
     */
    static class AgencyFeignMethod implements InvocationHandler{

        private String url;



        @Autowired
        private RestTemplate restTemplate;

        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            // restTemplate
            return new Object();
        }
    }


}
